package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;

/**
 * Created by lyh on 2017-06-01.
 */
@Entity
@Table(name = "m_seller", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class MSellerEntity extends IAcross
{
    public MSellerEntity()
    {
        super();
    }

    public MSellerEntity(IAcross ia)
    {
        super(ia);
    }
    private int sellerId;
    private String sellerCode;
    private int level;
    private String type;
    private int prevId;
    private String prevCode;
    private int prevLevel;
    private String prevType;

    @Id
    @Basic
    @Column(name = "seller_id")
    public int getSellerId() {
        return sellerId;
    }

    public void setSellerId(int sellerId) {
        this.sellerId = sellerId;
    }

    @Basic
    @Column(name = "seller_code", length = 20)
    public String getSellerCode() {
        return sellerCode;
    }

    public void setSellerCode(String sellerCode) {
        this.sellerCode = sellerCode;
    }

    @Basic
    @Column(name = "level")
    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Basic
    @Column(name = "type", length = 10)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "prev_id")
    public int getPrevId() {
        return prevId;
    }

    public void setPrevId(int prevId) {
        this.prevId = prevId;
    }

    @Basic
    @Column(name = "prev_code", length = 20)
    public String getPrevCode() {
        return prevCode;
    }

    public void setPrevCode(String prevCode) {
        this.prevCode = prevCode;
    }

    @Basic
    @Column(name = "prev_level")
    public int getPrevLevel() {
        return prevLevel;
    }

    public void setPrevLevel(int prevLevel) {
        this.prevLevel = prevLevel;
    }

    @Basic
    @Column(name = "prev_type", length = 10)
    public String getPrevType() {
        return prevType;
    }

    public void setPrevType(String prevType) {
        this.prevType = prevType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MSellerEntity that = (MSellerEntity) o;

        if (level != that.level) return false;
        if (prevId != that.prevId) return false;
        if (prevLevel != that.prevLevel) return false;
        if (sellerId != that.sellerId) return false;
        if (prevCode != null ? !prevCode.equals(that.prevCode) : that.prevCode != null) return false;
        if (prevType != null ? !prevType.equals(that.prevType) : that.prevType != null) return false;
        if (sellerCode != null ? !sellerCode.equals(that.sellerCode) : that.sellerCode != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = sellerId;
        result = 31 * result + (sellerCode != null ? sellerCode.hashCode() : 0);
        result = 31 * result + level;
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + prevId;
        result = 31 * result + (prevCode != null ? prevCode.hashCode() : 0);
        result = 31 * result + prevLevel;
        result = 31 * result + (prevType != null ? prevType.hashCode() : 0);
        return result;
    }
}
